﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Xml;
namespace Ecreate.Data
{
    public interface IDBEngine
    {
        #region 执行事务
        IDbTransaction BeginTransaction();
        bool CommitTrans();
        bool RollBack();
        //批量执行Sql语句
        bool ExecuteTransactionSql(List<String> list);
        bool ExecuteTransactionSql(List<SqlStruct> list);
        #endregion

        #region 操作数据集
        DataSet ExecuteDataSet(SqlStruct sqlStruct);
        DataSet ExecuteDataSet(string commandText);
        DataSet ExecuteDataSet(CommandType commandType, string commandText);
        DataSet ExecuteDataSet(string commandText, QueryParameterCollection commandParameters);
        DataSet ExecuteDataSet(string commandText, DataSet ds);
        DataSet ExecuteDataSet(string commandText, string tableName);
        DataSet ExecuteDataSet(CommandType commandType, string commandText, QueryParameterCollection commandParameters);
        DataSet ExecuteDataSet(CommandType commandType, string commandText, DataSet ds);
        DataSet ExecuteDataSet(CommandType commandType, string commandText, string tableName);
        DataSet ExecuteDataSet(string commandText, QueryParameterCollection commandParameters, DataSet ds);
        DataSet ExecuteDataSet(string commandText, QueryParameterCollection commandParameters, string tableName);
        DataSet ExecuteDataSet(string commandText, DataSet ds, string tableName);
        DataSet ExecuteDataSet(CommandType commandType, string commandText, QueryParameterCollection commandParameters, DataSet ds);
        DataSet ExecuteDataSet(CommandType commandType, string commandText, QueryParameterCollection commandParameters, string tableName);
        DataSet ExecuteDataSet(CommandType commandType, string commandText, DataSet ds, string tableName);
        DataSet ExecuteDataSet(string commandText, QueryParameterCollection commandParameters, DataSet ds, string tableName);
        DataSet ExecuteDataSet(CommandType commandType, string commandText, QueryParameterCollection commandParameters, DataSet ds, string tableName);
        DataSet ExecuteDataSet(string commandText, QueryParameterCollection commandParameters, DataSet ds, int startRecord, int maxRecords, string tableName);
        #endregion

        #region 操作数据表
        DataTable GetDataTable(string commandText);
        //根据Sql语句返回单独数据结果
        string GetResultString(string commandText);
        #endregion

        #region 获得表Schema框架
        DataTable GetDataSchemaByTableName(string commandText);
        #endregion

        #region 执行Sql语句
        int ExecuteNonQuery_inner(String commandText, bool inTrans);
        int ExecuteNonQuery(string commandText);
        #endregion

        #region 数据库状态
        void Open();
        void Close();
        bool IsClosed { get; }
        //测试连接是否成功
        bool TestConnection();
        Ecreate.Data.DataBaseType DatabaseType { get; }
        IDbConnection DbConnection { get; }
        #endregion




        IFace.IService getService();



    }
}
